<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>办事指南详情</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			html,body{background-color: #fff;}
			/*头部*/
			.mui-bar-nav>.fr{position:absolute;top:12px;right:10px;}
			.mui-bar-nav .fr>a{display:block;}
			.mui-bar-nav .fr>.collect_icon{width:20px;height:19px;background:url(../../images/index/collect.png ) no-repeat;background-size:100% 100%;float:left;margin-right:13px;}
			.mui-bar-nav .fr>.collect_icon_active{background:url(../../images/index/collect21@2x.png ) no-repeat;background-size:100% 100%;}
			.mui-bar-nav .fr>.share_icon{width:20px;height:19px;background:url(../../images/index/share.png ) no-repeat;background-size:100% 100%;float:left;margin-right:13px;}
			/*其他*/
			.mui-bar-nav~.mui-content{padding:0;margin-top:40px;}
			.mui-slider-item{min-height:10rem;}
			.mui-sliders{z-index:1;width:100%;overflow:hidden;margin:0 auto;background:#fff;}
			.mui-sliders .mui-slider-groups{position: absolute; top:2.40rem;bottom: 0;width: 100%;height: auto;overflow:auto;background:#fff;}
			.mui-sliders .mui-slider-groups .mui-slider-item {position: relative;display: inline-block;width: 100%;height: 100%;vertical-align: top; white-space: normal;}
			/*切换菜单*/
			.mui-segmented-control{width:6rem;overflow:hidden;margin:0 auto;background:#f4f4f4;border-radius:.1rem;height:.82rem;line-height:.82rem;margin-bottom:.35rem;margin-top:.47rem;}
			.mui-segmented-control .mui-control-item{line-height:.82rem;font-size:.30rem;}
			.mui-segmented-control .mui-control-item{color:#666}
			.mui-segmented-control .mui-control-item.mui-active{background:#1653fc;color:#fff;border-radius:.1rem;}
			.mui-segmented-control .mui-control-item,.mui-segmented-control{border:none;}
			/*基本信息*/
			.scroll_cont{width:7rem;overflow:hidden;margin:0 auto;}
			.scroll_cont .basic_info{width:100%;/*overflow:hidden;*/line-height:.42rem;/*height:.42rem;*/font-size:.35rem;/*max-height:1.3rem;*/}
			.basic_num{width:100%;color:#666666;font-size:.28rem;overflow:hidden;margin:.1rem 0 .65rem 0 ;white-space:nowrap;text-overflow:ellipsis;}
			.type_table{width:7rem;float:left;border-radius:.08rem;background:#f5f5f5;margin:.1rem 0;padding:.35rem 0 0 0;box-sizing:border-box;position:relative;}
			.type_table>ul{padding:0;margin:0;}
			.type_table>ul>li{width:45%;float:left;box-sizing:border-box;padding-left:.50rem;margin-bottom:.2rem;}
			.type_table>ul>li>label{width:100%;float:left;font-size:.30rem;line-height:.4rem;}
			.type_table>ul>li>span{color:#596c9f;font-size:.28rem;width:100%;float:left;line-height:.4rem;}
			.type_table>.man{position:absolute;right:.12rem;top:-.68rem;width:1.52rem;height:1.35rem;}
			.type_table>.man_tu{background:url(../../images/index/man.png) no-repeat;background-size:100% auto;}
			.type_table>.man .man_cont{position:relative;height:100%;width:100%;}
			.type_table>.man .man_cont>span{position:absolute;top:0;width:1.52rem;height:.35rem;color:#fff;color:#fff;font-size:.22rem;text-align:center;}
			 /*列表选项*/
		   .mui-table-view{position:inherit;width:100%;float:left;margin-bottom:1rem;padding-bottom:.5rem;;}
		   .mui-table-view-cell>a:not(.mui-btn),.mui-table-view-chevron .mui-table-view-cell>a:not(.mui-btn){margin:0;padding:0;}
		   .mui-table-view .mui-media-object{height:.4rem;text-align:center;max-width:.4rem;}
		   .mui-table-view .mui-media-bodys{font-size:.30rem;color:#666;margin:0 0 0 .1rem;float:left;width:3rem;overflow:hidden;height:.93rem;line-height:.93rem;}
		   .mui-table-view .mui-media-object.mui-pull-left{margin:0;margin-top:.26rem}
		   .mui-table-view-chevron .mui-table-view-cell{padding:0 .3rem;height:.93rem;line-height:.93rem;}
		   .bodys_info{float:right;font-size:.26rem;color:#999;margin-right:.4rem;}
		   .mui-navigate-right:after, .mui-push-right:after{right:0;color:#333;font-size:.35rem;margin-top:-.01rem;}
           .mui-table-view:after,.mui-table-view:before{height:0;}
           .mui-table-view-cell:after{left:.25rem;background-color:#e7e7e7;bottom:1px;}
			 /*提交按钮*/
			.menu_btn{position:fixed;bottom:0;height:1rem;border-top:1px solid #f5f5f5;background:#fff;left:0;width:100%;z-index:3;}
			.menu_btn>.menu_btn_box{width:6.3rem;overflow:hidden;height:.72rem;margin:.15rem auto;}
			.menu_btn>.menu_btn_box>button{padding:.2rem .55rem .2rem  1.2rem;line-height:1;font-size:.30rem;margin-right:.06rem;border-radius:.1rem;}
		    .menu_btn>.menu_btn_box>.mui-btn-warning{background:#ff7800 url(../../images/index/shenqing.png) no-repeat;background-position:.69rem center;background-size:.35rem .35rem;}
		    .menu_btn>.menu_btn_box>.mui-btn-primary{background:#117afd url(../../images/index/yuyue.png) no-repeat;background-position:.69rem center;background-size:.34rem .31rem;}
			 /*受理条件*/
			.term{width:7rem;padding-bottom:1rem;overflow:hidden;margin:0 auto;text-indent:2em;font-size:.30rem;line-height:.43rem;padding-top:.04rem;}
			 /*申请材料*/
			.material_cont{width:7.4rem;overflow:hidden;margin:0;background:#f5f5f5;float:right;padding-bottom:1rem;}
			.material_cont .material_list{width:100%;float:left;padding:.25rem 0 .15rem .15rem;background:#fff;margin-bottom:.15rem;}
			.material_cont .material_list .material_list_left{width:.46rem;float:left;margin-top:.1rem;}
			.material_cont .material_list .material_list_left>img{width:.42rem;height:.42rem;float:right;}
			.material_list_right{width:6.6rem;float:right;padding-bottom:.15rem;}
			.material_list_right>h6{width:95%;float:left;line-height:.55rem;font-size:.30rem;color:#333;margin:.1rem 0;/*overflow:hidden;white-space:nowrap;text-overflow:ellipsis;*/}
			.material_list_right>p{width:100%;float:left;line-height:.34rem;font-size:.28rem;color:#777;margin:0;}
		    .material_list_right>.lsit{width:100%;float:left;line-height:.64rem;/*height:.54rem;*/font-size:.28rem;color:#666;border-bottom:1px solid #f5f5f5;}	
			.material_list_right>.lsit .blue{color:#01b2e4;}
			.material_list_right>.lsit:last-child{border-bottom:none;}
			.none_arrow:after{content:""}
			.datum_info>span{font-size:.26rem;color:#777;float:left;max-width:45%;white-space:nowrap;float:left;margin-right:.25rem;line-height:.4rem;overflow:hidden;text-overflow:ellipsis;}
		 	.menu_btn>.menu_btn_box>.gray_btn{background:#c5c5c5 url(../../images/index/shenqing.png) no-repeat;border-color:#c5c5c5;background-position:.69rem center;background-size:.35rem .35rem;}
		    .menu_btn>.menu_btn_box>.gray_btn01{background:#c5c5c5 url(../../images/index/yuyue.png) no-repeat;border-color:#c5c5c5;background-position:.69rem center;background-size:.35rem .35rem;}
			</style>
	</head>
	<body>
		<!--头部-->
		<div class="mui-bar mui-bar-nav" id="header">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">办事详情</h1>
			<div class="fr" id="fr">
			    	<a class="collect_icon" id='collect_icon'></a>
			    	<a class="share_icon" id='share'></a>
		    </div>
		</div>
		<div class="mui-content" id="app">
			<input type="hidden"  id="effectiveFlow" />
		    <input type="hidden"  id="caseType" />
			<div class="mui-sliders">
				<div id="segmentedControl" class="mui-segmented-control">
					<a class="mui-control-item mui-active" href="#item1">
						基本信息
					</a>
					<a class="mui-control-item" href="#item2">
						受理条件
					</a>
					<a class="mui-control-item" href="#item3">
						申请材料
					</a>
				</div>
				<div class="mui-slider-groups" id="mui-slider-groups">
					<div id="item1" class="mui-control-content mui-active">
						<div id="scroll" class="">
							 <div class="scroll_cont basic_cont">
							 	<div class="basic_info" v-text="sxService.serviceName"></div>
							 	<div class="basic_num"  v-text="'业务序号：' + sxService.implementCode" ></div>
							 	<div class="type_table">
							 		<div class="man man_tu">
							 			<div class="man_cont">
							 				<span></span>
							 			</div>
							 		</div>
							 		<ul>
							 			<li>
							 				<label>事项类型</label>
							 				<span v-text="serviceTypeName"></span>
							 			</li>
							 			<li>
							 				<label>办件类型</label>
							 				<span v-if='sxService.caseType === "0"'>承诺件</span>
											<span v-else>即办件</span>
							 			</li>
							 			<li>
							 				<label>实施机构</label>
							 				<span v-text="implementOrganName"></span>
							 			</li>
							 			<li> 
							 				<label>服务对象</label>
							 				<span v-text="serviceObject"></span>
							 			</li>
							 			<li>
							 				<label>行使层级</label>
							 				<span v-text="sxService.levelName"></span>
							 			</li>
							 			<li>
							 				<label>是否支持网上支付</label>
							 				<span v-if='sxService.onlinePayFlag === "0"'>支持</span>
											<span v-else>不支持</span>
							 			</li>
							 			<li>
							 				<label>是否支持预约办理</label>
							 				<span v-if='sxService.appointmentFlag === "0"'>支持</span>
											<span v-else>不支持</span>
							 			</li>
							 			<li>
							 				<label>是否支持物流快递</label>
							 				<span v-if='sxService.expressFlag === "0"'>支持</span>
											<span v-else>不支持</span>
							 			</li>
							 			<li>
							 				<label>网上办理深度</label>
							 				<span v-text="handleDepth"></span>
							 			</li>
							 			<li>
							 				<label>结果样本类型</label>
							 				<span v-if='sxServiceExtend.resultSampleType === "0"'>证照</span>
							 				<span v-else-if='sxServiceExtend.resultSampleType === "1"'>批文</span>
											<span v-else>其它</span>
							 			</li>
							 			<li>
							 				<label>结果名称</label>
							 				<span v-text="sxServiceExtend.resultName"></span>
							 				<!--<span>结果样本：{{resultSampleAddrName}}</span>-->
							 			</li>
							 		</ul>
							 	</div>
							 </div>
							  <!--列表选项-->
								 <ul class="mui-table-view mui-table-view-chevron">
									<li class="mui-table-view-cell mui-media">
										<a class="mui-navigate-right" id='bl_location' :name='sxServiceExtend.extendOid'>
											<img class="mui-media-object mui-pull-left" src="../../images/index/banshi01.png" style="margin-top:.27rem">
											<div class="mui-media-bodys">办理地点/时间</div>
											<span class="bodys_info" v-text="locationNum+'个'"></span>
										</a>
									</li>
									<li class="mui-table-view-cell mui-media">
										<a id='consultTel' class="mui-navigate-right none_arrow" :href="'tel:'+sxService.consultTel" :tel="sxService.consultTel">
											<img class="mui-media-object mui-pull-left" src="../../images/index/banshi02.png" style="margin-top:.27rem">
											<div class="mui-media-bodys">咨询电话</div>
											<span class="bodys_info" v-text="sxService.consultTel"></span>
										</a>
									</li>
									<li class="mui-table-view-cell mui-media">
										<a id='superviseTel' class="mui-navigate-right none_arrow" :href="'tel:' + sxService.superviseTel" :tel="sxService.superviseTel">
											<img class="mui-media-object mui-pull-left" src="../../images/index/banshi02.png" style="margin-top:.27rem">
											<div class="mui-media-bodys">监督电话</div>
											<span class="bodys_info" v-text="sxService.superviseTel"></span>
										</a>
									</li>
									<li class="mui-table-view-cell mui-media" id='setAccord' :name='sxServiceExtend.setAccord'>
										<a class="mui-navigate-right">
											<img class="mui-media-object mui-pull-left" src="../../images/index/banshi03.png">
											<div class="mui-media-bodys">设定依据</div>
										</a>
									</li>
									<li class="mui-table-view-cell mui-media" id='handleFlow' :name='handleFlow'>
										<a class="mui-navigate-right">
											<img class="mui-media-object mui-pull-left" src="../../images/index/banshi04.png" style="margin-top:.25rem">
											<div class="mui-media-bodys" :name='handleFlow'>办事流程图</div>
										</a>
									</li>
									<li class="mui-table-view-cell mui-media" id='question' :name='sxService.serviceOid'>
										<a class="mui-navigate-right">
											<img class="mui-media-object mui-pull-left" src="../../images/index/banshi05.png" style="margin-top:.27rem">
											<div class="mui-media-bodys">常见问题</div>
										</a>
									</li>
								</ul>
						</div>
					</div>
					<div id="item2" class="mui-control-content">
						<template v-if="condition_show">
							<div class="" v-for="acceptCondition in acceptConditionList">
								<div class="term"> {{acceptCondition.conditionText}}</div>
							</div>
						</template>
						<template v-else>
							<div class="">
								<div class="term"> 暂无受理条件.....</div> 
							</div>
						</template>  
					</div>
					<div id="item3" class="mui-control-content" >
						<div class="material_cont" style="background-color:#fff;">
							<template v-if="material_show" v-for="material in materialList" >
								<div class="material_list" style="padding-top: 0;">
									<div class="material_list_left"><img src="../../images/index/file.png"></div>
									<div class="material_list_right">
										<h6>{{material.materialName}}</h6>
										<div class="lsit" v-if='material.materialType === "0"'>材料类型：原件</div>
										<div class="lsit" v-else-if='material.materialType === "1"'>材料类型：复印件</div>
										<div class="lsit" v-else>材料类型：电子版</div>
										<div class="lsit">材料规格：{{material.materialSpecification}}</div>
										<div class="lsit">受理标准：{{material.acceptStandard}}</div>
										
										<div class="lsit" v-if='material.materialSource === "0"'>来源渠道：申请人自备</div>
										<div class="lsit" v-else-if='material.materialSource === "1"'>来源渠道：政府部门核发</div>
										<div class="lsit" v-else>来源渠道：其它</div>
										<div class="lsit">材料样表：<a class="blue" :id='material.materialSampleAddr' :name="material.sysAttaType">{{material.materialSampleName}}</a></div>
										<div class="lsit">电子表格：<a class="blue" :id='material.electronicFormAddr' :name="material.electronicAttaType">{{material.electronicFormName}}</a></div>
									</div>
								</div> 
							</template>  
							<template v-else>
								<div style="background-color:#fff;">
									<div class="term"> 暂无申请材料.....</div> 
								</div>
							</template>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--按钮-->
		<div class="menu_btn">
			<div class="menu_btn_box mui-content-padded">
				<button type="button" id="init_netCase" class="mui-btn mui-btn-warning gray_btn01">网上申报</button>
				<button type="button" id="init_onlineBooking" class="mui-btn mui-btn-primary gray_btn01">网上预约</button>
			</div>
		</div>
	<script>
		function my_immersed(immersed){
			document.getElementById("header").style.paddingTop = immersed + 'px';
			document.getElementById("header").style.height = (immersed + 44) + 'px';
			document.getElementById("app").style.paddingTop = immersed + 'px';
			document.getElementById("fr").style.top = (immersed + 12) + 'px';
			document.getElementById("mui-slider-groups").style.top = (120+immersed) + 'px';
		}
	</script>
	<script src="../../js/immersed.js"></script>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script src="../../js/vue.min.js"></script>
	<script src="../../js/jquery2.2.4.min.js"></script>
	<script src="../../js/app.js"></script>
	<script type="text/javascript" src="../../js/file.js" ></script>
	<script>
		mui.init();
		
		if(!isAndroid()){
			document.getElementById("share").style.display = 'none';
		}
		
		var serviceOid = null;//从上一个页面获取的事项id
		var user = getUser();//注册用户
		var shoucang = null;
		var serObject = null;//事项服务对象标识符
		
		mui.plusReady(function(){
			document.querySelector(".mui-action-back").addEventListener('tap',function(){
				mui.back();
			},false);
			shoucang = document.getElementById("collect_icon");
			//添加收藏或取消收藏操作
			shoucang.addEventListener('tap',function(){
				var classname = this.getAttribute('class');
				if(classname == 'collect_icon'){//收藏
					saveOrCancelCollect(1);
				}else{//取消收藏
					saveOrCancelCollect(0);
				}
			},false);
			//plusReady 一个页面只执行一次
			mui.fire(plus.webview.currentWebview(),'getDetail',{serviceOid:utils.getUrlParam('serviceOid')});
		});
		
		window.addEventListener('getDetail',function(event){
			//closeWaitingAndShowView();
			serviceOid = event.detail.serviceOid;
			getZnDetail();
			checkIsCollect();//检查是否收藏
		},false);
		
		var vm = new Vue({
		  el: '#app',
		  data: {
		  	sxService:{implementCode:'',serviceName:''},
		  	serviceTypeName:'',
		  	implementOrganName:'',
		  	handleDepth:'', 
		  	serviceObject:'',
		  	sxServiceExtend:'',
		  	handleFlow:'',//办理流程图
		  	resultSampleAddrName:'',
		  	locationList:[{handleLocationOid:'',locationName:'',locationAddr:'',acceptDate:''}],//办理地点list
		  	locationNum:'',//办理地点个数, 
		  	condition_show:false,//受理条件是否展示
		  	acceptConditionList:[{conditionText:''}],
		  	material_show:false,//事项材料是否展示
		  	materialList:[{materialName:'',materialType:'',acceptStandard:'',materialSource:'',
		  		materialSampleName:'',materialSampleAddr:'',materialSpecification:'',
		  		electronicFormName:'',electronicFormAddr:'',electronicAttaType:''}]
		  }
		});  
		
		/**
		 * 获取办事指南详细信息
		 */
		function getZnDetail(){
			//ajax
			var param = 'serviceOid='+serviceOid;
 			utils.ajax('appHttpService/appBsznServiceInfo.do', function(data) {
				data = JSON.parse(data);
				if(data.code == '1'){
					mui.toast('系统内部错误');
					return;
				}else{
					var appService = data.result;
					if(appService != null){
						vm.sxService = appService;
						serObject = appService.serviceObject;
						//设置办件类型
						document.getElementById('caseType').value = appService.caseType;
						//设置有效流程状态
						document.getElementById('effectiveFlow').value = appService.effectiveFlow;
					}
					vm.serviceTypeName = data.serviceTypeName;
					vm.implementOrganName = data.implementOrganName;
					vm.handleDepth = data.handleDepth;
					vm.serviceObject = data.serviceObject;
					vm.sxServiceExtend = data.sxServiceExtend;
					vm.resultSampleAddrName = data.resultSampleAddrName;
					
					//法律依据
					var setAccord_fun = function() { 
						var setAccord = this.getAttribute("name");
						if(setAccord !='' && setAccord != null){
							utils.showWaiting();
		            			openNewWin("_www/src/work/bszn_setAccord.html",null,'bszn_setAccord',{setAccord:setAccord});
						}else{
							mui.toast("该事项暂无法律依据信息");
						}
						
					}
					//法律依据-查看详细信息
					document.getElementById("setAccord").addEventListener('tap',setAccord_fun);
				
					var location_size = 0;
					//办理地点list 
					var locations = JSON.parse(data.locationList);
					if(locations != null){
						var size = locations.length;
						vm.locationNum = size;
						if(size>0){
							vm.locationList = locations;
						}
						location_size = size;
					}else{
						vm.locationNum = 0;
						location_size=0;
					}
					
					//以下条件判断是控制预约按钮显示的
					if(appService != null && appService.appointmentFlag == "0" && location_size != 0){
						$("#init_onlineBooking").removeClass("gray_btn01");
					}
					//判断是否可在线办理
					if(data.handleForm != null && data.handleForm != ""){
						if(data.handleForm != '0'){
							if(data.serviceCharacter != "" && data.serviceCharacter != null && data.serviceCharacter == '1'){
								$("#init_netCase").removeClass("gray_btn01");
							}
						}
					}
					//办理地点和时间
					var blLocation_fun = function() {
						if(location_size != 0){
							utils.showWaiting();
							showTemplates('blLocation','办理地点及时间','_www/src/work/blLocation.html?extendOid=' + this.getAttribute("name"));
						}else{
							mui.toast("该事项暂无办理地点信息");
						}
						
					}
					//办理地点和时间-查看详细信息
					document.getElementById("bl_location").addEventListener('tap',blLocation_fun);
					
					
		            if(data.handleDepth == '一级标准'){
		            		$('.man').removeClass("man_tu"); 
		            }else if(data.handleDepth == '二级标准'){
		            		$('.man_cont span').text("只跑两次事项");
		            }else if(data.handleDepth == '三级标准'){
		            		$('.man_cont span').text("只跑一次事项");
		            }else{
		            		$('.man_cont span').text("只跑零次事项");
		            }
		            
		            //受理条件list
					var conditions = JSON.parse(data.acceptConditionList);
					if(conditions != null){
						var size = conditions.length;
						if(size>0){
							vm.condition_show = true;
							vm.acceptConditionList = conditions;
						}
					}
					
					//事项申请材料list
					var materials = JSON.parse(data.materialList);
					if(materials != null){
						var size = materials.length;
						if(size>0){
							vm.material_show = true;
							vm.materialList = materials;
						}
					} 
					
					vm.handleFlow = data.handleFlow;//办理流程图
					//办理流程图查看方法
					var handleFlow_fun = function() { 
						var handleFlow = this.getAttribute("name");
						if(handleFlow !='' && handleFlow != null){
							utils.showWaiting();
		            			openNewWin("_www/src/work/bszn_handleFlow.html",null,'bszn_handleFlow',{handleFlow:handleFlow});
						}else{
							mui.toast("该事项暂无流程图");
						}
						
					}
					//办理流程图-查看信息
					document.getElementById("handleFlow").addEventListener('tap',handleFlow_fun);
					
					
					//常见问题查看方法
					var question_fun = function() {
						var questionFlag = data.questionFlag;
						if(questionFlag){
							showTemplates('question_info','常见问题','_www/src/work/bszn_question.html?serviceOid=' + this.getAttribute("name"));
						}else{
							mui.toast("该事项暂无常见问题");
						}
						
					}
					//常见问题-查看
					document.getElementById("question").addEventListener('tap',question_fun);
					
				}
				closeWaitingAndShowView(); 
			}, param/*,{showWait:true}*/);
		}
		
		//检查是否已收藏
		function checkIsCollect() {
			var userId = getUserId();
			if(null != userId && "" != userId) {
				var url = 'appHttpService/appCheckIsCollect.do';
				var param = 'netUserId=' + userId + '&&serviceId=' + serviceOid;
				utils.ajax(url, function(data) {
					data = JSON.parse(data);
					if(data.result == 'success') { //已经收藏
						shoucang.setAttribute('class', 'collect_icon collect_icon_active');
					}else{
						
					}
				}, param, function(e) {
					mui.toast('网络连接失败'); 
				})
			}
		}
		
		//保存收藏或取消收藏
		function saveOrCancelCollect(isCollectFlag) { 
			var userId = getUserId();
			if(!userId) {
				showLogin(false);
				return;
			}
			var url = '';
			if(isCollectFlag == 1){ //添加收藏
				url = 'appHttpService/appSaveCollect.do';
			}else{ //取消收藏
				url = 'appHttpService/appCancelCollect.do';
			}
			utils.showWaiting();
			var param = 'netUserId=' + userId + '&&serviceId=' + serviceOid;
			utils.ajax(url, function(data) {
				//console.log(data);
				data = JSON.parse(data);
				if(isCollectFlag == 1) {
					if(data.result == '收藏成功') {
						shoucang.setAttribute('class', 'collect_icon collect_icon_active');
						mui.toast('收藏成功');
					} else {
						mui.toast('收藏失败');
					}
				} else {
					if(data.result == '成功取消收藏') {
						shoucang.setAttribute('class', 'collect_icon');
						mui.toast('取消收藏成功');
					} else {
						mui.toast('取消收藏失败');
					}
				}
				utils.closeWaiting();
			}, param, function(e) {
				mui.toast("网络连接失败");
			});
		}
		
		 //分享链接点击事件
	    if(document.getElementById("share"))document.getElementById("share").addEventListener('tap', function() {
	          var osType = 1;//ios
			if(plus.os.name == 'Android'){
				osType = 0;
			}
			var shareText = utils.HOST + 'wechat/initBsznView.shtml?serviceOid='+serviceOid;
			var shareTip = "推荐分享";
		 	share(shareTip, shareText)	  			
			
		});
		
		//材料样表下载
		mui("body").on('tap', '.lsit a', function() { 
			var materialOid = this.getAttribute('id');
			var fileType = this.getAttribute('name');
			var url = utils.HOST + 'appHttpService/appDownLoadFile.do?materialOid=' + materialOid;
			showOrDown(url,materialOid,null,fileType,function(path){
				openDir(path);
			})
		});
		
		//咨询电话 点击拨打
		document.getElementById("consultTel").addEventListener('tap',function(){
			plus.device.dial(this.getAttribute('tel'),false);
		},false);
		
		//投诉电话 点击拨打
		document.getElementById("superviseTel").addEventListener('tap',function(){
			plus.device.dial(this.getAttribute('tel'),false);
		},false);
		
		//跳转到在线申报流程页面
		document.getElementById("init_netCase").addEventListener('tap',function(){
			if($(this).hasClass('gray_btn01')){
         		mui.toast("暂不支持在线申报");
         		return;
         	}
			//先判断该事项是否是承诺件如果是承诺件验证承诺件事项是否有有效流程图和有效授权人 0表示承诺件
			if(document.getElementById('caseType').value == '0'){
				var url = 'appHttpService/appValideCnj.do';
				var param = 'serviceOid=' + serviceOid + '&&effectiveFlow=' + document.getElementById('effectiveFlow').value;
				utils.ajax(url, function(data) {
					data = JSON.parse(data);
					//验证通过
					if(data.state == '0') { 
						var user = getUser();
						if(!user){
							showLogin(false);
						}else{
							if( checkUserVerifyStatus(user) ){
								if(user.userType == "0"){
									if(serObject != null && serObject != undefined && serObject.indexOf("0") >= 0){
										openNewWin("_www/src/work/netCase/caseRegStep1.html",null,'netCase/caseRegStep1',{serviceId:serviceOid})
									}else if(serObject != null && serObject != undefined && serObject.indexOf("0") == -1){
										mui.alert("该事项只有法人可以办理!")
									}
								}else{
									mui.alert("暂不支持法人网上办理!");
								}
							}else{
								var message = "您尚未完成实名认证，请先到“我的-实名认证”中完成账号实名";
								if(user.userType == '1'){
									message = "您尚未完成实名认证,请到窗口完成实名认证"
								}
								mui.alert(message);
							}
						}
					}else{
						mui.toast(data.msg);
						return;
					}
				}, param)	
			}else{
				var user = getUser();
				if(!user){
					showLogin(false);
				}else{
					if( checkUserVerifyStatus(user) ){
						if(user.userType == "0"){
							if(serObject != null && serObject != undefined && serObject.indexOf("0") >= 0){
								openNewWin("_www/src/work/netCase/caseRegStep1.html",null,'netCase/caseRegStep1',{serviceId:serviceOid})
							}else if(serObject != null && serObject != undefined && serObject.indexOf("0") == -1){
								mui.alert("该事项只有法人可以办理!")
							}
						}else{
							mui.alert("暂不支持法人网上办理!");
						}
					}else{
						var message = "您尚未完成实名认证，请先到“我的-实名认证”中完成账号实名";
						if(user.userType == '1'){
							message = "您尚未完成实名认证,请到窗口完成实名认证"
						}
						mui.alert(message);
					}
				}
			}
		});
		
		//跳转到网上预约页面
		document.getElementById("init_onlineBooking").addEventListener('tap',function(){
			if($(this).hasClass('gray_btn01')){
         		mui.toast("暂不支持网上预约");
         	}else{
         		var user = getUser();
				if(!user){
					showLogin(false);
				}else{
					var userType = user.userType;
					if(!userType) return;
					if(userType == '0'){//个人
						if(serObject && serObject.indexOf('0') > -1 ){
							utils.showWaiting();
							showTemplates('onlineBooking','网上预约','_www/src/work/onlineBooking.html?serviceId='+serviceOid);
						}else{
							mui.alert("该事项只有法人可以预约!");
						}
					}else if(userType == '1'){//法人
						if(serObject && (
							serObject.indexOf('1') >-1 || serObject.indexOf('2')>-1 || serObject.indexOf('3') >-1 || serObject.indexOf('4') >-1 
						)){
							utils.showWaiting();
							showTemplates('onlineBooking','网上预约','_www/src/work/onlineBooking.html?serviceId='+serviceOid);
						}else{
							mui.alert("该事项不支持法人预约!");
						}
					}
				}
         	}
		})
		</script>
	</body> 
</html>
